<template>
  <div class="hello">
    名称：
    <el-input
      placeholder="输入用户名称"
      prefix-icon="el-icon-search"
      v-model="title"
      style="width: 200px;"
    ></el-input>
    <el-button type="primary" icon="el-icon-search" @click="query()" plain class="log-other">查询</el-button>


    <el-table v-bind:data="selectLists" @selection-change="selectionOne" class="log-container">
      <el-table-column type="selection" style="width: 60% height: 10"></el-table-column>

        <el-table-column prop="id" label="Id" width="120"></el-table-column>

      <el-table-column prop="loginUser" label="操作人" width="120"></el-table-column>


      <el-table-column prop="title" label="模块名称" width="120"></el-table-column>


      <el-table-column prop="action" label="操作名称" width="120"></el-table-column>


      <el-table-column prop="className" label="类名" width="120"></el-table-column>


      <el-table-column prop="methodName" label="方法名" width="120"></el-table-column>


      <el-table-column prop="format" label="操作时间" width="120"></el-table-column>


      <el-table-column label="操作">
        <template slot-scope="scope">
          <!-- <el-button v-on:click="toupdate(scope.$index,scope.row)" type="danger" size="small">编辑</el-button> -->
          <el-button v-on:click="deleteById(scope.row.id)" type="danger" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      @current-change="list"
      :current-page="pagination.pageNum"
      :page-count="pagination.totalPages"
      class="log-other"
    ></el-pagination>
  </div>
</template>
<script>


import axios from "axios";
var dataValue={
    selectLists:[],
    pagination:{},
    title:"",
    ids:[]
};


export default {
   data(){
     return dataValue;
   },
   mounted:function(){
       this.list(1);
   },
   methods:{
       list:function(page){
           var self=this;
           axios.get("http://localhost:8083/log/selctMogolist?page="+page).then(function(rep){
            self.pagination=rep.data;
            self.selectLists=rep.data.content;
           })
       },
       query:function(){
           var self=this;
           axios.get("http://localhost:8083/log/selctMogolist?title="+self.title).then(function(rep){
               self.selectLists=rep.data.content;
           })
       },
      selectionOne(val) {
      this.ids = val;
    }
   }
};
</script>

<style>
.log-container {
  opacity: 0.6;
}
.log-other {
  opacity: 0.8;
}
</style>